﻿
class arkadium.SharedObjectManager
{
	
	public var _cSharedObject:SharedObject 
	
	public function SharedObjectManager()
	{
		
	}
	
	public function onInitialize( sSOName:String){
		_cSharedObject = SharedObject.getLocal(sSOName);
		
	}
	
	public function saveData(sDataName:String, oDataValue:Object ){
		//trace("saving in shared " + dataName_s + " the value "+ dataValue_p);
		_cSharedObject.data[sDataName] = oDataValue;
		_cSharedObject.flush();
	}
	
	public function loadData(sDataName:String){
		//The challenge with loading data is that sometimes it won't exist
		//we need a way to populate this data if the value doesn't exist;
		//trace("loading from shared " + dataName_s + " the value "+ _cSharedObject.data[dataName_s]);
		return(_cSharedObject.data[sDataName]);
	}
	
	
	
}